There have been conventionally known the following bending angle detectors incorporated in bending machines such as press brakes.
(a) Contact type detectors which detect a bending angle of a workpiece, bringing a probe into contact with an inclined surface of the workpiece (e.g., Japanese Patent Publication Laid-Open No. 1-273618 (1989)). PA0 (b) Non-contact type detectors which include a plurality of distance sensors such as overcurrent sensors, electrostatic capacity sensors or optical sensors and which detect a bending angle of a workpiece by measuring the difference between the distances from the respective distance sensors to the workpiece (e.g., Japanese Patent Publication Laid-Open No. 63-49327 (1988), Japanese Patent Publication Laid-Open No. 64-2723 (1989), Japanese Patent Publication Laid-Open No. 1-271013 (1989)). PA0 (a) projecting means for projecting light onto the workpiece at a specified projecting angle to form a linear projected light image on the surface of the workpiece; PA0 (b) photographing means for photographing the surface of the workpiece on which the linear projected light image has been formed by the projecting means; PA0 (c) projected light image detecting means for detecting the inclination angle and position of the linear projected light image in an image produced by the photographing means; PA0 (d) memory means for storing data on the actual inclination angle of a specimen in correspondence with the inclination angle and position of the specimen in an image produced by the photographing means, the actual inclination angle being preliminarily given; and PA0 (e) calculating means for obtaining, by arithmetic operation, the bending angle of the workpiece by accessing the data stored in the memory means, using the inclination angle and position of the linear projected light image detected by the projected light image detecting means. PA0 (a) brightness detecting means for detecting the brightness of each of pixels which constitute the gray-scale image; PA0 (b) main pixel calculating means for (i) performing arithmetic operation on a specified scanning axis in an image coordinate system, to obtain a main pixel associated with the optical axis of the bright zone from the distribution of the brightness of the pixels aligned on the scanning axis detected by the brightness detecting means and (ii) repeatedly performing the arithmetic operation on other scanning axes which are arranged at specified intervals, whereby a plurality of main pixels are obtained; and PA0 (c) main straight line calculating means for obtaining the main straight line of the bright zone from a plurality of main pixels obtained by the main pixel calculating means. PA0 (a) projecting means for projecting, at a specified projecting angle, light onto a workpiece and onto a part of a lower bender on which the workpiece is placed, such that a linear projected light image is formed on the surfaces of the workpiece and the lower bender; PA0 (b) photographing means for photographing the surfaces of the workpiece and the lower bender on which the linear projected light image has been formed by the projecting means; PA0 (c) point sequence forming means for performing binary conversion and image thinning process on an image produced by the photographing means, thereby forming a sequence of points which is representative of the image and whose unit is a pixel; PA0 (d) straight line component extracting means for extracting a straight line component associated with the image of the workpiece from the sequence of points obtained by the point sequence forming means, said straight line component being linked to a straight line component associated with the image of the lower bender; and PA0 (e) projected light image detecting means for detecting the inclination angle and position of the linear projected light image of the workpiece in the image produced by the photographing means, based on the straight line component extracted by the straight line component extracting means. PA0 (a) simulation data calculating means for obtaining, by arithmetic operation, simulation data associated with the bending state of the workpiece in each bending step from bending processing conditions for the workpiece; and PA0 (b) potential bending step calculating means for obtaining, by arithmetic operation, a potential bending step in which the bending angle detection of the workpiece might be performed by the bending angle detecting means, from the simulation data obtained by the simulation data calculating means.
These bending angle detectors however present the following drawbacks.
Firstly, the contact-type detectors cannot be suitably used when detecting a bending angle of a workpiece with short legs, as these detectors require comparatively long legs to ensure a high measuring accuracy. Further, if the contact-type detectors are used for a long time, long contact with workpieces causes the probe to be worn and deformed, resulting in a decreased measuring accuracy.
In the case of the non-contact type detectors, a plurality of distance sensors are employed for measuring and calculating the distance from each sensor to a bent workpiece, but a long space cannot be kept between one sensor and another so that a satisfactory detecting accuracy cannot be obtained. Further, the non-contact type detectors employing overcurrent sensors or electrostatic capacity sensors have the disadvantage that since the outputs of these sensors vary depending on the material of a workpiece to be measured, so that measuring conditions have to be changed whenever a different material is used. The non-contact type detectors employing optical sensors also have the disadvantage that light directed to the surface of a workpiece disperses in some surface conditions, which leads to an increased measuring error and a decreased measuring accuracy. Another disadvantage of this type is that the measuring accuracy is dependent on sensors to be used and the resolving power of the image receptor.
One proposal to overcome the foregoing drawbacks is set out in Japanese Patent Publication Laid-Open No. 4-145315 (1992) where a slit light or two spot lights are directed onto the surface of a workpiece and a light image formed on the surface of the workpiece is photographed by a photographing means to detect a bending angle through image processing. In this bending angle detector, an optical system is arranged such that, as shown in FIG. 28, the optical axis of incident light upon the photographing means (i.e., camera) lies within a plane perpendicular to the irradiated surface of the workpiece W. In this arrangement, the following equations hold:
tan .theta.'=d/1 (a)
tan .theta.=h/1 (b)
tan .alpha.=d/h (c)
where .alpha. is a beam projecting angle, i.e., the angle at which a slit light (or two spot lights) is directed onto the surface of the workpiece W; .theta.' is the angle formed by the slit light in an image plane; .theta. is a bending angle of the workpiece W (hereinafter referred to as "work angle"); and d, h, l respectively represent the lengths shown in FIG. 28.
From Equations (a), (b) and (c), the following equation (d) is obtained. EQU tan .theta.'=d/1=d/h.times.h/1 EQU =tan .alpha..times.tan .theta. (d)
In Equation (d), since the beam projecting angle .alpha. is given, the work angle can be obtained by arithmetic operation if the angle .theta.' is detected by image processing.
As one example of the image processing technique, a device which linearizes image using the linear least square method is disclosed in Japanese Patent Publication Laid-Open No. 4-62683 (1992). In this processing device, a straight line component is extracted from a binary image. More specifically, the number of pixels constituting a binary image is reduced without spoiling the straight line approximation characteristics of the binary image, and the straight line component of the binary image is extracted based on the number of remaining pixels.
An alternative proposal is disclosed in Japanese Patent Publication No. 4-70091 (1992) where a bending angle detector attached to a press brake is freely movable so that it can be positioned at a desired position when detecting a bending angle of a workpiece.
However, the bending angle detector according to the first proposal suffers from several disadvantages. Firstly, it has been proved that it is difficult to accurately calculate the work angle .theta. from Equation (d), since the field of a camera serving as the photographing means is spread because of the angle of view of the lens. That is, the relationship between the work angle .theta. and the angle .theta.' formed by the slit light in the image plane is not so simple as Equation (d) when taking the effects of the angle of view of the lens into consideration. In order to calculate the work angle .theta. more accurately, it is necessary to use a function F (.alpha., 1.sub.a, f, w . . . ) which involves optical conditions such as the distance 1.sub.a between the camera and the workpiece, the focal length f of the lens and the dimension of the image receptor w. In this case, Equation (d) is expressed as follows. EQU tan .theta.'=F(.alpha., 1.sub.a, f, w . . . ).times.tan .theta.(e)
For calculating the work angle e from Equation (e), a mathematical method may be used to obtain the function F (.alpha., 1.sub.a, f, w . . . ), but in such a case, variations in parameters in individual members such as a lens cannot be taken into account and this results in an increased error. Therefore, various parameters in each member should be obtained through experiments. However, it is extremely difficult to carry out rigorous measurement in an optical system. Further, since the distance 1.sub.a between the camera and the workpiece, which is one of the parameters, varies according bending processing conditions (die size, the thickness of a sheet-like workpiece, etc.), a specialized means is required for measuring the distance 1.sub.a, which brings about a complexity in the mechanism.
Another problem lies in the process in which an image (a linear projected light image) formed on the surface of the workpiece is photographed by the photographing means and image processing is carried out. In the measurement of the image at the Job site, an optimum threshold for binary conversion fluctuates due to the influence of external light and the instability of the light source, so that the shape of the bright zone after the binary conversion varies whenever measurement is carried out. Further, unevenness in the color of the surface of a workpiece or rolling traces inherent to steel plates often cause irregular reflection of beams. This irregular reflection leads to such undesirable situations that (i) the bright zone does not assume the shape of a straight line, (ii) the edge becomes rugged, or (iii) holes B are formed in the bright zone A as shown in FIG. 29 and in these situations, it is difficult to obtain a satisfactorily thin linear image. As a result, the image C which has been thinned by image processing has wavy portions or whisker-like portions (short lines) D which are the cause of errors in extracting a main straight line.
Still another problem arises when a workpiece which has a bent portion is bent. In practical bending processing in which a workpiece is bent with upper and lower dies, a workpiece to be photographed is not always in the form of a flat sheet. When the bending processing is applied to a workpiece having a bent portion, there is a likelihood that the bent portion and/or a part of the lower die are also photographed by the camera. If binary conversion and image thinning process are performed on such an image, an error will be caused in the position of the center of gravity and the inclination of the image.
In spite of the fact that detection of a bending angle of a workpiece by the use of a bending angle detector is difficult or impossible in some cases, for example, where a workpiece of a particular shape is used or a finished article of a particular shape is required, conventional NC devices are not designed to deal with such data concerning the bending angle detector as control data. Therefore, in a bending machine equipped with such a bending angle detector, control operation is difficult to be carried out by means of an NC device.